import java.util.*;

public class t3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入初始数值大小:");
        int[] arr = new int[sc.nextInt()];
        int i = 0;
        for(::){
            System.out.println("请给第"+(i+1)+"个元素赋值");
            arr[i++] = sc.nextInt();
            if(i/(arr.length*1.0)>=0.8){
                arr = copyOf(arr);
                System.out.println(Arrays.toString(arr));
            }
        }
    }

    public static int[] copyOf(int[] arr){
        int [] newArr = new int[(int)(arr.length*1.5)];
        for (int i=0;i<arr.length;i++){
            newArr[i] = arr[i];
        }
        return newArr;
    }
}